/**
 * 
 */
package com.cp16.tss.model;

import java.util.ArrayList;
import java.util.Collection;
import java.util.Date;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.ElementCollection;
import javax.persistence.Embedded;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinTable;
import javax.persistence.ManyToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 * @author GiangHN
 * @version 1.0
 * @since 01/01/2014
 * 
 */
@Entity
@Table(name = "SERVICE")
public class Service {
	@Id
	@GeneratedValue(strategy = GenerationType.AUTO)
	@Column(name = "ID", nullable = false)
	private int ID;
	@Column(name = "SERVICE_ID", nullable = false)
	private String serviceId;
	@Column(name = "SERVICE_NAME")
	private String serviceName;
	@ManyToMany(cascade = CascadeType.ALL)
	private Collection<Phone> phoneList = new ArrayList<Phone>();
	@Column(name = "SERVICE_PRICE")
	private int servicePrice;
	@Embedded
	@ElementCollection
	@JoinTable(name = "SERVICE_DEVICE")
	private Collection<Device> deviceList = new ArrayList<Device>();
	@Column(name = "DATE_HAND_OVER")
	@Temporal(TemporalType.DATE)
	private Date dateHandOver;
	@ManyToMany(mappedBy = "lstSercives", cascade = CascadeType.ALL)
	private Collection<Customer> customerList = new ArrayList<Customer>();

	/**
	 * @return the iD
	 */
	public int getID() {
		return ID;
	}

	/**
	 * @param iD
	 *            the iD to set
	 */
	public void setID(int iD) {
		ID = iD;
	}

	/**
	 * @return the serviceId
	 */
	public String getServiceId() {
		return serviceId;
	}

	/**
	 * @param serviceId
	 *            the serviceId to set
	 */
	public void setServiceId(String serviceId) {
		this.serviceId = serviceId;
	}

	/**
	 * @return the serviceName
	 */
	public String getServiceName() {
		return serviceName;
	}

	/**
	 * @param serviceName
	 *            the serviceName to set
	 */
	public void setServiceName(String serviceName) {
		this.serviceName = serviceName;
	}

	/**
	 * @return the phoneList
	 */
	public Collection<Phone> getPhoneList() {
		return phoneList;
	}

	/**
	 * @param phoneList
	 *            the phoneList to set
	 */
	public void setPhoneList(Collection<Phone> phoneList) {
		this.phoneList = phoneList;
	}

	/**
	 * @return the servicePrice
	 */
	public int getServicePrice() {
		return servicePrice;
	}

	/**
	 * @param servicePrice
	 *            the servicePrice to set
	 */
	public void setServicePrice(int servicePrice) {
		this.servicePrice = servicePrice;
	}

	/**
	 * @return the deviceList
	 */
	public Collection<Device> getDeviceList() {
		return deviceList;
	}

	/**
	 * @param deviceList
	 *            the deviceList to set
	 */
	public void setDeviceList(Collection<Device> deviceList) {
		this.deviceList = deviceList;
	}

	/**
	 * @return the dateHandOver
	 */
	public Date getDateHandOver() {
		return dateHandOver;
	}

	/**
	 * @param dateHandOver
	 *            the dateHandOver to set
	 */
	public void setDateHandOver(Date dateHandOver) {
		this.dateHandOver = dateHandOver;
	}

	/**
	 * @return the customerList
	 */
	public Collection<Customer> getCustomerList() {
		return customerList;
	}

	/**
	 * @param customerList
	 *            the customerList to set
	 */
	public void setCustomerList(Collection<Customer> customerList) {
		this.customerList = customerList;
	}

}
